<script setup>
import { DropdownMenuSubTrigger } from 'radix-vue'
import { ChevronRightIcon } from 'lucide-vue-next'
import { cn } from '../../utils'

const props = defineProps({
  class: { type: String, required: false },
  inset: { type: Boolean, required: false },
})
</script>

<template>
  <DropdownMenuSubTrigger
    v-bind="$attrs"
    :class="cn(
      'focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
      inset && 'pl-8',
      props.class,
    )"
  >
    <slot />
    <ChevronRightIcon class="ml-auto h-4 w-4" />
  </DropdownMenuSubTrigger>
</template>
